﻿using System;
using System.Data;
using System.Web.UI.WebControls;

namespace VijayGande.WebParts.Classes
{
    static class Helper
    {
        public static DataRow Create2ColumnRow(String Text, String Value, DataTable dt)
        {
            // Create a DataRow using the DataTable defined in the
            // CreateDataSource method.
            DataRow dr = dt.NewRow();
            // This DataRow contains the ColorTextField and ColorValueField
            // fields, as defined in the CreateDataSource method. Set the
            // fields with the appropriate value. Remember that column 0
            // is defined as ColorTextField, and column 1 is defined as
            // ColorValueField.
            dr[0] = String.IsNullOrEmpty(Text) ? "NullOrEmpty" : Text;
            dr[1] = String.IsNullOrEmpty(Value) ? "NullOrEmpty" : Value;
            return dr;
        }

        public static void ShowMessage(Label lblCtrl, String message)
        {
            lblCtrl.Text += message + "<br/>";
        }
    }
}